Attribute Release Policies
The attribute release policy decides how attributes are selected and provided to a given application in the final
CAS response. Additionally, each policy has the ability to apply an optional filter to weed out their attributes based on their values.
The following settings are shared by all attribute release policies:
| Name |
Value |
authorizedToReleaseCredentialPassword |
Boolean to define whether the service is authorized to release the credential as an attribute. |
authorizedToReleaseProxyGrantingTicket |
Boolean to define whether the service is authorized to release the proxy-granting ticket id as an attribute. |
excludeDefaultAttributes |
Boolean to define whether this policy should exclude the default global bundle of attributes for release. |
authorizedToReleaseAuthenticationAttributes |
Boolean to define whether this policy should exclude the authentication/protocol attributes for release. Authentication attributes are considered those that are not tied to a specific principal and define extra supplementary metadata about the authentication event itself, such as the commencement date. |
principalIdAttribute |
An attribute name of your own choosing that will be stuffed into the final bundle of attributes, carrying the CAS authenticated principal identifier. |
Usage Warning!Think VERY CAREFULLY before turning on
the above settings. Blindly authorizing an application to receive a proxy-granting ticket or the user credential
may produce an opportunity for security leaks and attacks. Make sure you actually need to enable those features and that
you understand the why. Avoid where and when you can, specially when it comes to sharing the user credential.
CAS makes a distinction between attributes that convey metadata about the authentication event versus
those that contain personally identifiable data for the authenticated principal.
Actuator Endpoints
The following endpoints are provided by CAS:
The following settings and properties are available from the CAS configuration catalog:
The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.
|
cas.monitor.endpoints.jdbc.password-encoder.encoding-algorithm=
The encoding algorithm to use such as MD5. Relevant when the type used is DEFAULT or GLIBC_CRYPT.
org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties.
|
cas.monitor.endpoints.jdbc.password-encoder.type=NONE
Define the password encoder type to use. Type may be specified as blank or NONE to disable password encoding. It may also refer to a fully-qualified class name that implements the Spring Security's PasswordEncoder interface if you wish you define your own encoder. The following types may be used: NONE: No password encoding (i.e. plain-text) takes place. DEFAULT: Use the DefaultPasswordEncoder of CAS. For message-digest algorithms via character-encoding and encoding-algorithm. BCRYPT: Use the BCryptPasswordEncoder based on the strength provided and an optional secret. SCRYPT: Use the SCryptPasswordEncoder. PBKDF2: Use the Pbkdf2PasswordEncoder based on the strength provided and an optional secret. STANDARD: Use the StandardPasswordEncoder based on the secret provided. SSHA: Use the LdapShaPasswordEncoder supports Ldap SHA and SSHA (salted-SHA). The values are base-64 encoded and have the label {SHA</code> or {SSHA</code> prepended to the encoded hash. GLIBC_CRYPT: Use the GlibcCryptPasswordEncoder based on the encoding-algorithm, strength provided and an optional secret. org.example.MyEncoder: An implementation of PasswordEncoder of your own choosing. file:///path/to/script.groovy: Path to a Groovy script charged with handling password encoding operations.
org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties.
|
cas.monitor.endpoints.jdbc.driver-class=org.hsqldb.jdbcDriver
The JDBC driver used to connect to the database.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.password=
The database connection password.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.url=jdbc:hsqldb:mem:cas-hsql-database
The database connection URL.
This setting supports the Spring Expression Language.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.user=sa
The database user. The database user must have sufficient permissions to be able to handle schema changes and updates, when needed.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.
|
cas.monitor.endpoints.jdbc.password-encoder.character-encoding=UTF-8
The encoding algorithm to use such as 'UTF-8'. Relevant when the type used is DEFAULT.
org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties.
|
cas.monitor.endpoints.jdbc.password-encoder.secret=
Secret to use with STANDARD, PBKDF2, BCRYPT, GLIBC_CRYPT password encoders. Secret usually is an optional setting.
org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties.
|
cas.monitor.endpoints.jdbc.password-encoder.strength=16
Strength or number of iterations to use for password hashing. Usually relevant when dealing with PBKDF2 or BCRYPT encoders. Used by GLIBC_CRYPT encoders as well.
org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties.
|
cas.monitor.endpoints.jdbc.autocommit=false
The default auto-commit behavior of connections in the pool. Determined whether queries such as update/insert should be immediately executed without waiting for an underlying transaction.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.batch-size=100
A non-zero value enables use of JDBC2 batch updates by Hibernate. e.g. recommended values between 5 and 30.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.data-source-name=
Attempts to do a JNDI data source look up for the data source name specified. Will attempt to locate the data source object as is.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.ddl-auto=update
Hibernate feature to automatically validate and exports DDL to the schema. By default, creates and drops the schema automatically when a session is starts and ends. Setting the value to validate or none may be more desirable for production, but any of the following options can be used: validate: Validate the schema, but make no changes to the database. update: Update the schema. create: Create the schema, destroying previous data. create-drop: Drop the schema at the end of the session. none: Do nothing. Note that during a version migration where any schema has changed create-drop will result in the loss of all data as soon as CAS is started. For transient data like tickets this is probably not an issue, but in cases like the audit table important data could be lost. Using `update`, while safe for data, is confirmed to result in invalid database state. validate or none settings are likely the only safe options for production use. For more info, see this.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.default-catalog=
Qualifies unqualified table names with the given catalog in generated SQL.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.default-schema=
Qualify unqualified table names with the given schema/tablespace in generated SQL.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.dialect=org.hibernate.dialect.HSQLDialect
The database dialect is a configuration setting for platform independent software (JPA, Hibernate, etc) which allows such software to translate its generic SQL statements into vendor specific DDL, DML.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.fail-fast-timeout=1
Set the pool initialization failure timeout. - Any value greater than zero will be treated as a timeout for pool initialization. The calling thread will be blocked from continuing until a successful connection to the database, or until the timeout is reached. If the timeout is reached, then a
PoolInitializationException will be thrown. - A value of zero will not prevent the pool from starting in the case that a connection cannot be obtained. However, upon start the pool will attempt to obtain a connection and validate that the
connectionTestQuery and connectionInitSql are valid. If those validations fail, an exception will be thrown. If a connection cannot be obtained, the validation is skipped and the the pool will start and continue to try to obtain connections in the background. This can mean that callers to DataSource#getConnection() may encounter exceptions. - A value less than zero will not bypass any connection attempt and validation during startup, and therefore the pool will start immediately. The pool will continue to try to obtain connections in the background. This can mean that callers to
DataSource#getConnection() may encounter exceptions. Note that if this timeout value is greater than or equal to zero (0), and therefore an initial connection validation is performed, this timeout does not override the connectionTimeout or validationTimeout; they will be honored before this timeout is applied. The default value is one millisecond.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.fetch-size=100
Used to specify number of rows to be fetched in a select query.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.generate-statistics=false
Allow hibernate to generate query statistics.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.health-query=
The SQL query to be executed to test the validity of connections. This is for "legacy" databases that do not support the JDBC4 Connection.isValid() API.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.idle-timeout=PT10M
Controls the maximum amount of time that a connection is allowed to sit idle in the pool.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.isolate-internal-queries=false
This property determines whether data source isolates internal pool queries, such as the connection alive test, in their own transaction. Since these are typically read-only queries, it is rarely necessary to encapsulate them in their own transaction. This property only applies if #autocommit is disabled.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.isolation-level-name=ISOLATION_READ_COMMITTED
Defines the isolation level for transactions. @see org.springframework.transaction.TransactionDefinition
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.leak-threshold=3000
Controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.physical-naming-strategy-class-name=org.apereo.cas.hibernate.CasHibernatePhysicalNamingStrategy
Fully-qualified name of the class that can control the physical naming strategy of hibernate.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.propagation-behavior-name=PROPAGATION_REQUIRED
Defines the propagation behavior for transactions. @see org.springframework.transaction.TransactionDefinition
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.properties=
Additional settings provided by Hibernate (or the connection provider) in form of key-value pairs.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.query=
Query to execute in order to authenticate users via JDBC. Example: SELECT username,password,enabled FROM users WHERE username=?
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.read-only=false
Configures the Connections to be added to the pool as read-only Connections.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.role-prefix=
Prefix to add to the role.
org.apereo.cas.configuration.model.core.monitor.JdbcSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jdbc.pool.keep-alive-time=0
This property controls the keepalive interval for a connection in the pool. An in-use connection will never be tested by the keepalive thread, only when it is idle will it be tested. Default is zero, which disables this feature.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.max-size=18
Controls the maximum number of connections to keep in the pool, including both idle and in-use connections.
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.max-wait=PT2S
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.maximum-lifetime=PT10M
This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.min-size=6
Controls the minimum size that the pool is allowed to reach, including both idle and in-use connections.
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.name=
Set the name of the connection pool. This is primarily used for the MBean to uniquely identify the pool configuration.
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.suspension=false
Whether or not pool suspension is allowed. There is a performance impact when pool suspension is enabled. Unless you need it (for a redundancy system for example) do not enable it.
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
cas.monitor.endpoints.jdbc.pool.timeout-millis=1000
The maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
org.apereo.cas.configuration.model.support.ConnectionPoolingProperties.
|
Control global properties that are relevant to Hibernate,
when CAS attempts to employ and utilize database resources,
connections and queries.
|
cas.jdbc.case-insensitive=false
When choosing physical table names, determine whether names should be considered case-insensitive.
|
cas.jdbc.gen-ddl=true
Whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.
|
cas.jdbc.physical-table-names=
Indicate a physical table name to be used by the hibernate naming strategy in case table names need to be customized for the specific type of database. The key here indicates the CAS-provided table name and the value is the translate physical name for the database. If a match is not found for the CAS-provided table name, then that name will be used by default.
|
cas.jdbc.show-sql=false
Whether SQL queries should be displayed in the console/logs.
|
If you need to design your own password encoding scheme where the type is specified as a fully
qualified Java class name, the structure of the class would be similar to the following:
1
2
3
4
5
6
7
8
9
10
11
| package org.example.cas;
import org.springframework.security.crypto.codec.*;
import org.springframework.security.crypto.password.*;
public class MyEncoder extends AbstractPasswordEncoder {
@Override
protected byte[] encode(CharSequence rawPassword, byte[] salt) {
return ...
}
}
|
If you need to design your own password encoding scheme where the type is
specified as a path to a Groovy script, the structure of the script would be similar to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| import java.util.*
byte[] run(final Object... args) {
def rawPassword = args[0]
def generatedSalt = args[1]
def logger = args[2]
def casApplicationContext = args[3]
logger.debug("Encoding password...")
return ...
}
Boolean matches(final Object... args) {
def rawPassword = args[0]
def encodedPassword = args[1]
def logger = args[2]
def casApplicationContext = args[3]
logger.debug("Does match or not ?");
return ...
|
The following settings and properties are available from the CAS configuration catalog:
The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.
|
cas.monitor.endpoints.ldap.base-dn=
Base DN to use. There may be scenarios where different parts of a single LDAP tree could be considered as base-dns. Rather than duplicating the LDAP configuration block for each individual base-dn, each entry can be specified and joined together using a special delimiter character. The user DN is retrieved using the combination of all base-dn and DN resolvers in the order defined. DN resolution should fail if multiple DNs are found. Otherwise the first DN found is returned. Usual syntax is: subtreeA,dc=example,dc=net|subtreeC,dc=example,dc=net.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.bind-credential=
The bind credential to use when connecting to LDAP.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.bind-dn=
The bind DN to use when connecting to LDAP. LDAP connection configuration injected into the LDAP connection pool can be initialized with the following parameters: bindDn/bindCredential provided - Use the provided credentials to bind when initializing connections. bindDn/bindCredential set to * - Use a fast-bind strategy to initialize the pool. bindDn/bindCredential set to blank - Skip connection initializing; perform operations anonymously. - SASL mechanism provided - Use the given SASL mechanism to bind when initializing connections.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.ldap-url=
The LDAP url to the server. More than one may be specified, separated by space and/or comma.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.search-filter=
User filter to use for searching. Syntax is cn={user} or cn={0}. You may also provide an external groovy script in the syntax of file:/path/to/GroovyScript.groovy to fully build the final filter template dynamically.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.type=AUTHENTICATED
The authentication type. AD - Users authenticate with sAMAccountName. AUTHENTICATED - Manager bind/search type of authentication. If { principalAttributePassword</code> is empty then a user simple bind is done to validate credentials. Otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it. ANONYMOUS: Similar semantics as AUTHENTICATED except no bindDn and bindCredential may be specified to initialize the connection. If principalAttributePassword is empty then a user simple bind is done to validate credentials. Otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it. - DIRECT: Direct Bind - Compute user DN from format string and perform simple bind. This is relevant when no search is required to compute the DN needed for a bind operation. Use cases for this type are: 1) All users are under a single branch in the directory,
e.g. ou=Users,dc=example,dc=org. 2) The username provided on the CAS login form is part of the DN, e.g. uid=%s,ou=Users,dc=example,dc=org.
Available values are as follows:
AD: Active Directory.AUTHENTICATED: Authenticated Search.DIRECT: Direct Bind.ANONYMOUS: Anonymous Search.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.
|
cas.monitor.endpoints.ldap.allow-multiple-dns=false
Whether search/query results are allowed to match on multiple DNs, or whether a single unique DN is expected for the result.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.allow-multiple-entries=false
Set if multiple Entries are allowed.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.binary-attributes=
Indicate the collection of attributes that are to be tagged and processed as binary attributes by the underlying search resolver.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.block-wait-time=PT3S
The length of time the pool will block. By default the pool will block indefinitely and there is no guarantee that waiting threads will be serviced in the order in which they made their request. This option should be used with a blocking connection pool when you need to control the exact number of connections that can be created
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.connect-timeout=PT5S
Sets the maximum amount of time that connects will block.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.connection-strategy=
If multiple URLs are provided as the ldapURL this describes how each URL will be processed. ACTIVE_PASSIVE First LDAP will be used for every request unless it fails and then the next shall be used. ROUND_ROBIN For each new connection the next url in the list will be used. RANDOM For each new connection a random LDAP url will be selected. DNS_SRV LDAP urls based on DNS SRV records of the configured/given LDAP url will be used.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.deref-aliases=
Define how aliases are de-referenced. Accepted values are: NEVER SEARCHING: dereference when searching the entries beneath the starting point but not when searching for the starting entry. FINDING: dereference when searching for the starting entry but not when searching the entries beneath the starting point. ALWAYS: dereference when searching for the starting entry and when searching the entries beneath the starting point.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.disable-pooling=false
Whether to use a pooled connection factory in components.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.dn-format=
Specify the dn format accepted by the AD authenticator, etc. Example format might be uid=%s,ou=people,dc=example,dc=org.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.enhance-with-entry-resolver=true
Whether specific search entry resolvers need to be set on the authenticator, or the default should be used.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.fail-fast=true
Attempt to populate the connection pool early on startup and fail quickly if something goes wrong.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.follow-referrals=true
Set if search referrals should be followed.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.hostname-verifier=DEFAULT
Hostname verification options.
Available values are as follows:
DEFAULT: Default option, forcing verification.ANY: Skip hostname verification and allow all.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.idle-time=PT10M
Removes connections from the pool based on how long they have been idle in the available queue. Prunes connections that have been idle for more than the indicated amount.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.keystore=
Path to the keystore used for SSL connections. Typically contains SSL certificates for the LDAP server.
This setting supports the Spring Expression Language.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.keystore-password=
Keystore password.
This setting supports the Spring Expression Language.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.keystore-type=
The type of keystore. PKCS12 or JKS. If left blank, defaults to the default keystore type indicated by the underlying Java platform.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.max-pool-size=10
Maximum LDAP connection pool size which the pool can use to grow.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.min-pool-size=3
Minimum LDAP connection pool size. Size the pool should be initialized to and pruned to
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.name=
Name of the LDAP handler.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.page-size=0
Request that the server return results in batches of a specific size. See RFC 2696. This control is often used to work around server result size limits. A negative/zero value disables paged requests.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.pool-passivator=BIND
You may receive unexpected LDAP failures, when CAS is configured to authenticate using DIRECT or AUTHENTICATED types and LDAP is locked down to not allow anonymous binds/searches. Every second attempt with a given LDAP connection from the pool would fail if it was on the same connection as a failed login attempt, and the regular connection validator would similarly fail. When a connection is returned back to a pool, it still may contain the principal and credentials from the previous attempt. Before the next bind attempt using that connection, the validator tries to validate the connection again but fails because it’s no longer trying with the configured bind credentials but with whatever user DN was used in the previous step. Given the validation failure, the connection is closed and CAS would deny access by default. Passivators attempt to reconnect to LDAP with the configured bind credentials, effectively resetting the connection to what it should be after each bind request. Furthermore if you are seeing errors in the logs that resemble a 'Operation exception encountered, reopening connection' type of message, this usually is an indication that the connection pool’s validation timeout established and created by CAS is greater than the timeout configured in the LDAP server, or more likely, in the load balancer in front of the LDAP servers. You can adjust the LDAP server session’s timeout for connections, or you can teach CAS to use a validity period that is equal or less than the LDAP server session’s timeout. Accepted values are: NONE: No passivation takes place. BIND: The default behavior which passivates a connection by performing a bind operation on it. This option requires the availability of bind credentials when establishing connections to LDAP.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.principal-attribute-password=
If principalAttributePassword is empty then a user simple bind is done to validate credentials otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it. For the anonymous authentication type, if principalAttributePassword is empty then a user simple bind is done to validate credentials otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.prune-period=PT2H
Removes connections from the pool based on how long they have been idle in the available queue. Run the pruning process at the indicated interval.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.resolve-from-attribute=
If this attribute is set, the value found in the first attribute value will be used in place of the DN.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.response-timeout=PT5S
Duration of time to wait for responses.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-authorization-id=
SASL authorization id.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-mechanism=
The SASL mechanism.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-mutual-auth=
SASL mutual auth is enabled?
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-quality-of-protection=
SASL quality of protected.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-realm=
The SASL realm.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.sasl-security-strength=
SASL security strength.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers=
Search handlers.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.subtree-search=true
Whether subtree searching is allowed.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.trust-certificates=
Path of the trust certificates to use for the SSL connection. Ignores keystore-related settings when activated and used.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.trust-manager=
Trust Manager options. Trust managers are responsible for managing the trust material that is used when making LDAP trust decisions, and for deciding whether credentials presented by a peer should be accepted. Accepted values are: * DEFAULT: Enable and force the default JVM trust managers. ANY: Trust any client or server.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.trust-store=
Path to the keystore used to determine which certificates or certificate authorities should be trusted. Used when connecting to an LDAP server via LDAPS or startTLS connection. If left blank, the default truststore for the Java runtime is used.
This setting supports the Spring Expression Language.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.trust-store-password=
Password needed to open the truststore.
This setting supports the Spring Expression Language.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.trust-store-type=
The type of trust keystore that determines which certificates or certificate authorities are trusted. Types depend on underlying java platform, typically PKCS12 or JKS. If left blank, defaults to the default keystore type indicated by the underlying Java platform.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.use-start-tls=false
Whether TLS should be used and enabled when establishing the connection.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.validate-on-checkout=true
Whether connections should be validated when loaned out from the pool.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.validate-period=PT5M
Period at which pool should be validated.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.validate-periodically=true
Whether connections should be validated periodically when the pool is idle.
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.validate-timeout=PT5S
Period at which validation operations may time out.
This settings supports the
java.time.Duration syntax [?].
org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.allow-multiple-results=false
Indicate whether the LDAP search query is allowed to return multiple entries.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.base-dn=
Base DN to start the search.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.group-attribute=
Attribute expected to be found on the entry resulting from the group search whose value is going to be used to construct roles. The final value is always prefixed with #groupPrefix. This is useful in scenarios where you wish to grant access to a resource to all users who a member of a given group.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.group-base-dn=
Base DN to start the search looking for groups.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.group-filter=
Search filter to begin looking for groups.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.group-prefix=
A prefix that is prepended to the group attribute value to construct an authorized role.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.role-attribute=uugid
Attribute expected to be found on the entry whose value is going to be used to construct roles. The final value is always prefixed with #rolePrefix. This is useful in scenarios where you wish to grant access to a resource to all users who carry a special attribute.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.role-prefix=ROLE_
Prefix for the role.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.ldap-authz.search-filter=
LDAP search filter to locate accounts.
org.apereo.cas.configuration.model.support.ldap.LdapAuthorizationProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-name-case-change=
The Attribute name case change.
org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-names=
The Attribute names.
org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-value-case-change=
The Attribute value case change.
org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.dn-case-change=
The Dn case change.
org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].dn-attribute.add-if-exists=
The Add if exists.
org.apereo.cas.configuration.model.support.ldap.DnAttributeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].dn-attribute.dn-attribute-name=entryDN
The Dn attribute name.
org.apereo.cas.configuration.model.support.ldap.DnAttributeSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].merge-attribute.attribute-names=
The Attribute names.
org.apereo.cas.configuration.model.support.ldap.MergeAttributesSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].merge-attribute.merge-attribute-name=
The Merge attribute name.
org.apereo.cas.configuration.model.support.ldap.MergeAttributesSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].primary-group-id.base-dn=
The Base dn.
org.apereo.cas.configuration.model.support.ldap.PrimaryGroupIdSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].primary-group-id.group-filter=(&(objectClass=group)(objectSid={0}))
The Group filter.
org.apereo.cas.configuration.model.support.ldap.PrimaryGroupIdSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].recursive.merge-attributes=
The Merge attributes.
org.apereo.cas.configuration.model.support.ldap.RecursiveSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].recursive.search-attribute=
The Search attribute.
org.apereo.cas.configuration.model.support.ldap.RecursiveSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.search-entry-handlers[0].type=
The type of search entry handler to choose.
Available values are as follows:
ACTIVE_DIRECTORY: Process the entry results fetched from active directory and
check for account status controls for disabled/expired accounts, etc.OBJECT_GUID: Object guid search entry handler.
Handles the objectGUID attribute fetching and conversion.OBJECT_SID: Object sid search entry handler.
Handles the objectSid attribute fetching and conversion.CASE_CHANGE: Case change search entry handler.
Provides the ability to modify the case of search entry DNs, attribute names, and attribute values.DN_ATTRIBUTE_ENTRY: DN attribute entry handler.
Adds the entry DN as an attribute to the result set. Provides
a client side implementation of RFC 5020.MERGE: Merge search entry handler.
Merges the values of one or more attributes into a single attribute.PRIMARY_GROUP: Primary group search handler.
Constructs the primary group SID and then searches for
that group and puts it's DN in the memberOf attribute of the original search entry.RANGE_ENTRY: Range entry search handler.
Rewrites attributes returned from Active Directory to
include all values by performing additional searches.RECURSIVE_ENTRY: Recursive entry search handler.
This recursively searches based on a supplied
attribute and merges those results into the original entry.MERGE_ENTRIES: Merge entries handler.
Merges the values of one or more attributes in all entries into a single attribute. The merged attribute may or may not already
exist on the entry. If it does exist it's existing values will remain intact.
org.apereo.cas.configuration.model.support.ldap.LdapSearchEntryHandlersProperties.
|
cas.monitor.endpoints.ldap.validator.attribute-name=objectClass
Attribute name to use for the compare validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.attribute-value=top
Attribute values to use for the compare validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.base-dn=
Base DN to use for the search request of the search validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.dn=
DN to compare to use for the compare validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.scope=OBJECT
Search scope to use for the search request of the search validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.search-filter=(objectClass=*)
Search filter to use for the search request of the search validator.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
cas.monitor.endpoints.ldap.validator.type=search
Determine the LDAP validator type. The following LDAP validators can be used to test connection health status: search: Validates a connection is healthy by performing a search operation. Validation is considered successful if the search result size is greater than zero. none: No validation takes place. compare: Validates a connection is healthy by performing a compare operation.
org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.
|
LDAP Scriptable Search Filter
LDAP search filters can point to an external Groovy script to dynamically construct the final filter template.
The script itself may be designed as:
1
2
3
4
5
6
7
8
9
10
11
12
| import org.ldaptive.*
import org.springframework.context.*
def run(Object[] args) {
def filter = (FilterTemplate) args[0]
def parameters = (Map) args[1]
def applicationContext = (ApplicationContext) args[2]
def logger = args[3]
logger.info("Configuring LDAP filter")
filter.setFilter("uid=something")
}
|
The following parameters are passed to the script:
| Parameter |
Description |
filter |
FilterTemplate to be updated by the script and used for the LDAP query. |
parameters |
Map of query parameters which may be used to construct the final filter. |
applicationContext |
Reference to the Spring ApplicationContext reference. |
logger |
The object responsible for issuing log messages such as logger.info(...). |
The following settings and properties are available from the CAS configuration catalog:
The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.
The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.
|
cas.monitor.endpoints.jaas.login-config=
JAAS login resource file.
org.apereo.cas.configuration.model.core.monitor.JaasSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jaas.login-context-name=
The login context name should coincide with a given index in the login config specified. This name is used as the index to the configuration specified in the login config property. JAASTest { org.springframework.security.authentication.jaas.TestLoginModule required; </code>; In the above example, JAASTest should be set as the context name.
org.apereo.cas.configuration.model.core.monitor.JaasSecurityActuatorEndpointsMonitorProperties.
|
cas.monitor.endpoints.jaas.refresh-configuration-on-startup=true
If set, a call to Configuration#refresh() will be made by #configureJaas(Resource) method.
org.apereo.cas.configuration.model.core.monitor.JaasSecurityActuatorEndpointsMonitorProperties.
|
Authentication Attributes
During the authentication process, a number of attributes get captured and collected by CAS
to describe metadata and additional properties about the nature of the authentication event itself.
These typically include attributes that are documented and classified by the underlying protocol
or attributes that are specific to CAS which may describe the type of credentials used, successfully-executed
authentication handlers, date/time of the authentication, etc.
Releasing authentication attributes to service providers and applications can be
controlled to some extent.
The following settings and properties are available from the CAS configuration catalog:
The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.
The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.
|
cas.authn.authentication-attribute-release.enabled=true
Whether CAS authentication/protocol attributes should be released as part of ticket validation.
org.apereo.cas.configuration.model.core.authentication.AuthenticationAttributeReleaseProperties.
|
cas.authn.authentication-attribute-release.never-release=
List of authentication attributes that should never be released.
org.apereo.cas.configuration.model.core.authentication.AuthenticationAttributeReleaseProperties.
|
cas.authn.authentication-attribute-release.only-release=
List of authentication attributes that should be the only ones released. An empty list indicates all attributes should be released.
org.apereo.cas.configuration.model.core.authentication.AuthenticationAttributeReleaseProperties.
|
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc. When possible, properties should be stored in
lower-case kebab format, such as cas.property-name=value.S ettings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.
Protocol/authentication attributes may also be released conditionally on a per-service basis.
Principal Attributes
Principal attributes typically convey personally identifiable data about the authenticated user,
such as address, last name, etc. Release policies are available in CAS and documented below
to explicitly control the collection of attributes that may be authorized for release to a given application.
RememberDepending on the protocol used and the type/class of service (i.e. relying party) registered with CAS,
additional release policies may become available that allow more fine-tuned control over attribute release, catering better to the needs of the particular
authentication protocol at hand. Remember to verify attribute release capabilities of CAS by visiting and studies the appropriate documentation for each protocol.
Default
CAS provides the ability to release a bundle of principal attributes to all services by default. This bundle
is not defined on a per-service basis and is always combined with attributes produced by the specific
release policy of the service, such that for instance, you can devise rules to always release givenName
and cn to every application, and additionally allow other specific principal attributes for
only some applications per their attribute release policy.
The following settings and properties are available from the CAS configuration catalog:
The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.
The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.
|
cas.authn.attribute-repository.core.default-attributes-to-release=
CAS provides the ability to release a bundle of principal attributes to all services by default. This bundle is not defined on a per-service basis and is always combined with attributes produced by the specific release policy of the service, such that for instance, you can devise rules to always release givenName and cn to every application, and additionally allow other specific principal attributes for only some applications per their attribute release policy.
org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesCoreProperties.
|
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc. When possible, properties should be stored in
lower-case kebab format, such as cas.property-name=value.S ettings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.
Return All
Return all resolved principal attributes to the service,
and optionally exclude attributes from the final collection.
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllAttributeReleasePolicy",
"excludedAttributes": ["java.util.LinkedHashSet", ["cn"]]
}
}
|
Return Static
Return static attributes to the service with values hard-coded in the service definition.
1
2
3
4
5
6
7
8
9
10
11
12
13
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"attributeReleasePolicy" : {
"@class": "org.apereo.cas.services.ReturnStaticAttributeReleasePolicy",
"allowedAttributes": {
"@class": "java.util.LinkedHashMap",
"permissions": [ "java.util.ArrayList", [ "read", "write", "admin" ] ]
}
}
}
|
Attribute values can use the Spring Expression Language syntax.
Deny All
Never ever return principal attributes to applications. Note that this policy
also skips and refuses to release default attributes, if any.
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"description" : "sample",
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.DenyAllAttributeReleasePolicy"
}
}
|
Return Allowed
Only return the principal attributes that are explicitly allowed by the service definition.
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy",
"allowedAttributes" : [ "java.util.ArrayList", [ "cn", "mail", "sn" ] ]
}
}
|
Attributes authorized and allowed for release by this policy may not necessarily be available
as resolved principal attributes and can be resolved on the fly dynamically
using the attribute definition store.
Return Encrypted
Encrypt and encode all all allowed attributes in base-64 using the assigned registered service public key.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnEncryptedAttributeReleasePolicy",
"allowedAttributes" : [ "java.util.ArrayList", [ "cn", "mail", "sn" ] ]
},
"publicKey" : {
"@class" : "org.apereo.cas.services.RegisteredServicePublicKeyImpl",
"location" : "classpath:public.key",
"algorithm" : "RSA"
}
}
|
The keys can be generated via the following commands:
1
2
3
| openssl genrsa -out private.key 1024
openssl rsa -pubout -in private.key -out public.key -inform PEM -outform DER
openssl pkcs8 -topk8 -inform PER -outform DER -nocrypt -in private.key -out private.p8
|
Attributes authorized and allowed for release by this policy may not necessarily be available
as resolved principal attributes and can be resolved on the fly dynamically
using the attribute definition store.
REST
Only return the principal attributes that are explicitly allowed by contacting a REST endpoint. Endpoints must be designed to
accept/process application/json. The expected response status code is 200 where the body of
the response includes a Map of attributes linked to their values.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 100,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnRestfulAttributeReleasePolicy",
"endpoint" : "https://somewhere.example.org",
"headers": {
"@class": "java.util.LinkedHashMap",
"header": "value"
}
}
}
|
The following parameters are passed to the endpoint:
| Parameter |
Description |
principal |
The object representing the authenticated principal. |
service |
The object representing the corresponding service definition in the registry. |
The body of the submitted request may also include a Map of currently resolved attributes.
Return Mapped
Similar to above, this policy will return a collection of allowed principal attributes for the
service, but also allows those principal attributes to be mapped and “renamed” at the more granular service level.
For example, the following configuration will recognize the resolved
attributes eduPersonAffiliation and groupMembership and will then
release affiliation and group to the web application configured.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"description" : "sample",
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
"allowedAttributes" : {
"@class" : "java.util.TreeMap",
"eduPersonAffiliation" : "affiliation",
"groupMembership" : "group"
}
}
}
|
Attributes authorized and allowed for release by this policy may not necessarily be available
as resolved principal attributes and can be resolved on the fly dynamically
using the attribute definition store.
Return MultiMapped
The same policy may allow attribute definitions to be renamed and remapped to multiple attribute names,
with duplicate attributes values mapped to different names.
For example, the following configuration will recognize the resolved attribute eduPersonAffiliation and will then
release affiliation and personAffiliation whose values stem from the original eduPersonAffiliation attribute
while groupMembership is released as group. In other words, the eduPersonAffiliation attribute is
released twice under two different names each sharing the same value.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
"allowedAttributes" : {
"@class" : "java.util.TreeMap",
"eduPersonAffiliation" : [ "java.util.ArrayList", [ "affiliation", "personAffiliation" ] ],
"groupMembership" : "group"
}
}
}
|
Attributes authorized and allowed for release by this policy may not necessarily be available
as resolved principal attributes and can be resolved on the fly dynamically
using the attribute definition store.
Pattern Matching
This policy allows the release of defined allowed attributes only if the attrribute value(s)
matches the given regular expression pattern. If the attribute value is matched successfully, the policy
is then able to apply transformation rules on the value to extract
and collect the matched groups to then assemble the final attribute value.
For example, consider an authenticated principal with a memberOf attribute
which contains values such as CN=g1,OU=example,DC=org, and CN=g2,OU=example,DC=org. The following policy
applies the defined pattern and the transformation on each attribute value. The final result would be a memberOf
attribute with values g1@example.org and g2@example.org.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class": "org.apereo.cas.services.PatternMatchingAttributeReleasePolicy",
"allowedAttributes": {
"@class": "java.util.TreeMap",
"memberOf": {
"@class": "org.apereo.cas.services.PatternMatchingAttributeReleasePolicy$Rule",
"pattern": "^CN=(\\w+),\\s*OU=(\\w+),\\s*DC=(\\w+)",
"transform": "${1}@${2}/${3}"
}
}
}
}
|
Matched pattern groups typically start at 1. If you need to refer to the entire matched region, use ${0}.
Inline Groovy Attributes
Principal attributes that are mapped may produce their values from an inline groovy script. As an example, if you currently
have resolved a uid attribute with a value of piper, you could then consider the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
"allowedAttributes" : {
"@class" : "java.util.TreeMap",
"uid" : "groovy { return attributes['uid'].get(0) + ' is great' }"
}
}
}
|
In the above snippet, the value of the uid attribute name is mapped to the result of the inline groovy script.
Inline scripts always begin with the syntax groovy {...} and are passed the current collection of resolved
attributes as an attributes binding variable. The result of the script can be a single/collection of value(s).
The above configuration will produce a uid attribute for the application whose value is a concatenation of
the original value of uid plus the words “ is great”, so the final result would be “piper is great”.
File-based Groovy Attributes
Identical to inline groovy attribute definitions, except the groovy script can also be externalized to a .groovy file:
1
2
3
4
5
6
7
8
9
10
11
12
13
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
"allowedAttributes" : {
"@class" : "java.util.TreeMap",
"uid" : "file:/etc/cas/sample.groovy"
}
}
}
|
The sample.groovy script itself may have the following outline:
1
2
3
4
5
6
7
8
| import java.util.*
def run(final Object... args) {
def attributes = args[0]
def logger = args[1]
logger.debug("Current attributes are {}", attributes)
return []
}
|
The configuration of this component qualifies to use the Spring Expression Language syntax.
Groovy Script
Let an external Groovy script decide how principal attributes should be released. The configuration of this
component qualifies to use the Spring Expression Language syntax.
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.GroovyScriptAttributeReleasePolicy",
"groovyScript" : "classpath:/script.groovy"
}
}
|
The script itself may be designed in Groovy as:
1
2
3
4
5
6
7
8
9
10
11
| import java.util.*
def run(final Object... args) {
def currentAttributes = args[0]
def logger = args[1]
def principal = args[2]
def service = args[3]
logger.debug("Current attributes received are {}", currentAttributes)
return [username:["something"], likes:["cheese", "food"], id:[1234,2,3,4,5], another:"attribute"]
}
|
The following parameters are passed to the script:
| Parameter |
Description |
currentAttributes |
Map of attributes currently resolved and available for release. |
logger |
The object responsible for issuing log messages such as logger.info(...). |
principal |
The object representing the authenticated principal. |
service |
The object representing the corresponding service definition in the registry. |
Script Engines
Usage
This feature is deprecated and is scheduled to be removed in the future.
Use alternative script engine implementations and other programming languages to configure attribute release policies. This approach
takes advantage of scripting functionality built into the Java platform via additional libraries and drivers. While Groovy should be
natively supported by CAS, the following module is required in the overlay to include support for additional languages
such as Python, etc.
1
2
3
4
5
| <dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-script-engines</artifactId>
<version>${cas.version}</version>
</dependency>
|
1
| implementation "org.apereo.cas:cas-server-support-script-engines:${project.'cas.version'}"
|
1
2
3
4
5
6
7
8
9
| dependencyManagement {
imports {
mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
}
}
dependencies {
implementation "org.apereo.cas:cas-server-support-script-engines"
}
|
The service definition then may be designed as:
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ScriptedRegisteredServiceAttributeReleasePolicy",
"scriptFile" : "classpath:/script.[py|js|groovy]"
}
}
|
The configuration of this component qualifies to use
the Spring Expression Language syntax. The scripts
need to design a run function that receives a list of parameters. The collection of current attributes in process
as well as a logger object are passed to this function. The result must produce a map whose keys are attributes names
and whose values are a list of attribute values.
As an example, the script itself may be designed in Groovy as:
1
2
3
4
5
6
7
8
9
| import java.util.*
def Map<String, List<Object>> run(final Object... args) {
def currentAttributes = args[0]
def logger = args[1]
logger.debug("Current attributes received are {}", currentAttributes)
return[username:["something"], likes:["cheese", "food"], id:[1234,2,3,4,5], another:"attribute"]
}
|
Here’s the same script written in Python:
1
2
3
4
5
| def run(*Params):
Attributes = Params[0]
Logger = Params[1]
# Calculate attributes and return a new dictionary of attributes...
return ...
|
You are also allowed to stuff inlined groovy scripts into the scriptFile attribute. The script
has access to the collection of resolved attributes as well as a logger object.
1
2
3
4
5
6
7
8
9
10
| {
"@class" : "org.apereo.cas.services.CasRegisteredService",
"serviceId" : "sample",
"name" : "sample",
"id" : 300,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ScriptedRegisteredServiceAttributeReleasePolicy",
"scriptFile" : "groovy { return attributes }"
}
}
|
Attribute Repository Filtering
Attribute release policies can be assigned a principalAttributesRepository to consult attribute sources
defined and controlled by Person Directory attribute repositories
to fetch, resolve, cache and release attributes. To learn more about this topic, please see this guide.
Chaining Policies
Attribute release policies can be chained together to
process multiple rules. See this guide to learn more.
Attribute Value Filters
While each policy defines what principal attributes may be allowed for a given service,
there are optional attribute filters that can be set per policy to further weed out attributes based on their values.
See this guide to learn more.